<html><head><title>SaveFileRequester</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">SaveFileRequester()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Filename$ = <font color="#006666"><b>SaveFileRequester</b></font>(Title$, DefaultFile$, Pattern$, PatternPosition)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Opens the standard requester for the user to save a file. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>Title$</i></td>
<td width="90%"> 
The title of the requester window. 

</td></tr>
<tr><td><i>DefaultFile$</i></td>
<td> 
The filename to use when the requester is opened. 

</td></tr>
<tr><td><i>Pattern$</i></td>
<td> 
A standard filter which allow to display only the files which 
end with such or such extension. It must be in the following form : "Text 
file | *.txt | Music file | *.mus;*.mod" The pattern always work by pair: name 
(which really appears in the filter) and extension (ie: *.txt). Several 
extensions can be specified for a single type by using the ; (semi-colon) 
separator (not supported on OSX, the requester always displays all files). 

</td></tr>
<tr><td><i>PatternPosition</i></td>
<td> 
It specifies which pattern must be the default. It begin 
from 0 up to the number of pattern. Once the requester has been closed, 
<a href="selectedfilepattern.html">SelectedFilePattern()</a> can be used to get back 
the selected pattern (not supported on OSX). 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

The selected filename, or an empty string if the requester has been canceled by the user. 

</blockquote><p><b>Remarks</b></p><blockquote>

The returned 'Filename$' can be easily split into file, path and extension string with the following 
functions: <a href="../filesystem/getfilepart.html">GetFilePart()</a>, <a href="../filesystem/getpathpart.html">GetPathPart()</a> and <a href="../filesystem/getextensionpart.html">GetExtensionPart()</a>. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  StandardFile$ = "C:\autoexec.bat"   <font color="#006666">; set initial file+path to display</font>
  <font color="#006666">; With next string we will set the search patterns ("|" as separator) for file displaying:</font>
  <font color="#006666">;  1st: "Text (*.txt)" as name, ".txt" and ".bat" as allowed extension</font>
  <font color="#006666">;  2nd: "PureBasic (*.pb)" as name, ".pb" as allowed extension</font>
  <font color="#006666">;  3rd: "All files (*.*) as name, "*.*" as allowed extension, valid for all files</font>
  Pattern$ = "Text (*.txt)|*.txt;*.bat|PureBasic (*.pb)|*.pb|All files (*.*)|*.*"
  Pattern = 0    <font color="#006666">; use the first of the three possible patterns as standard</font>
  File$ =<font color="#006666"> SaveFileRequester</font>("Please choose file to save", StandardFile$, Pattern$, Pattern)
  <b><font color="#006666">If</font></b> File$
<font color="#006666">    MessageRequester</font>("Information", "You have selected following file:"+<font color="#006666">Chr</font>(10)+File$, 0)
  <b><font color="#006666">Else</font></b>
<font color="#006666">    MessageRequester</font>("Information", "The requester was canceled.", 0) 
  <b><font color="#006666">EndIf</font></b>
</font></pre>
<br>
<p><img src="../HelpPictures/savefilerequester.png"></p>

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=pathrequester.html>PathRequester()</a> - <a href=index.html>Requester Index</a> - <a href=selectedfilepattern.html>SelectedFilePattern()</a> ->

</body></html>